package com.test.ssm.article.dao;

import com.test.ssm.article.entity.pojo.Article;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticleMapper {
    boolean deleteByPrimaryKey(String newsId);

    boolean insert(Article record);

    boolean insertSelective(Article record);

    Article selectByPrimaryKey(String newsId);

    boolean updateByPrimaryKeySelective(Article record);

    boolean updateByPrimaryKeyWithBLOBs(Article record);

    boolean updateByPrimaryKey(Article record);

    List<Article> getAll(@Param("newsState") Byte newsState,
                         @Param("newsTitle") String newsTitle,
                         @Param("pageNum") Integer pageNum,
                         @Param("pageSize") Integer pageSize);

    Article selectOneByTitle(String newsTitle);

    Long countAllByLike(@Param("state") Integer newsState,
                        @Param("title") String newsTitle);

    Boolean deleteOneById(String newsId);

    int batchDelete(String newsIds);
}